{template 'public/header'}
{template 'public/comhead'}
<link rel="stylesheet" type="text/css" href="../addons/zh_tcwq/template/public/ygcsslist.css">
<ul class="nav nav-tabs">
	<span class="ygxian"></span>
	<div class="ygdangq">当前位置:</div>    
	<li class="active"><a href="{php echo $this->createWebUrl('activity')}">票卷信息</a></li>

</ul>
<div class="main">
	<div class="panel panel-default">
		<div class="panel-heading">
			票卷列表
		</div>
		<div class="panel-body" style="padding: 0px 15px;">
			<div class="row">
				<table class="yg5_tabel col-md-12">
					<tr class="yg5_tr1">
						<th class="store_td1 col-md-1">卷名称</th>                       
						<th class="col-md-2">类型</th>
						<th class="col-md-2">价格</th>                     
						<th class="col-md-1">总张数</th>
						<th class="col-md-1">限制张数</th>
						<th class="col-md-2">是否需要审核</th>
						<th class="col-md-2">操作</th>
					</tr>
					{loop $list $row}
					<tr class="yg5_tr2">
						<!-- <td><div class="type-parent">{$row['orderby']}&nbsp;&nbsp;</div></td> -->
						<tr class="yg5_tr2">
							<td class="num{$row['id']}">
								<span class="numspan{$row['id']}">{$row['tk_name']}</span>
							</td>
							{if $row['type']==1}                           
							<td>免费</td>
							{elseif $row['type']==2}
							<td>收费</td>
							{/if}
							<td>{$row['money']}</td>
							<td>{$row['total_num']}</td>
							<td>{$row['limit_num']}</td>
							{if $row['bm_check']==1}
							<td >
								<span class="label storered">是</span>
							</td >
							{elseif $row['bm_check']==2}
							<td >
							<span class="label storeblue">否</span>
							</td>
							
							{/if}  
							<td>
								<a href="{php echo $this->createWebUrl('addhdpj', array('id' => $row['id'],'hd_item'=>1))}" class="storespan btn btn-xs">
									<span class="fa fa-pencil"></span>
									<span class="bianji">编辑
										<span class="aritemdown"></span>
									</span>                            
								</a>
								<a class="storespan btn btn-xs" href="{php echo $this->createWebUrl('hdpjlist', array('id' => $row['id'],'op'=>'delete','activity_id'=>$row['activity_id']))}" onclick="return confirm('确认删除吗？');return false;">
									<span class="fa fa-trash-o"></span>
									<span class="bianji">删除
										<span class="aritemdown"></span>
									</span>
								</a>
							</td>
						</tr>
						<div class="modal fade" id="myModali{$row['id']}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
							<div class="modal-dialog" role="document">
								<div class="modal-content">
									<div class="modal-header">
										<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
										<h4 class="modal-title" style="font-size: 20px;">报名信息</h4>
									</div>
									<div class="modal-body" style="font-size: 14px">
										<div class="infomenu"></div>
									</div>
									<div class="modal-footer">
										<button type="button" class="btn btn-default" data-dismiss="modal">确定</button>
									</div>
								</div>
							</div>
						</div>

						<script type="text/javascript">
							$(function(){
								$(".info{$row['id']}").click(function(){
									$(".infomenu").html("");
									var infocha = $("#infocha{$row['id']}").val();
									console.log("id号是:"+infocha);
									$.ajax({
										type:"post",
										url:"{$_W['siteroot']}/app/index.php?i={$_W['uniacid']}&c=entry&do=GetBmInfo&m=zh_gjhdbm",
										dataType:"text",
										data:{order_num:infocha},
										success:function(data){
											var data = eval('('+data+')');
											console.log(data);
											if(data.length==0){
												$(".infomenu").html("暂时没有信息！");
											}else{
												for(var i=0;i<data.length;i++){                
													console.log(data[i].name+data[i].value+"数据条数"+i);
													var infolist = $('<p><span>'+data[i].name+'</span>'+'：<span>'+data[i].value+'</span></p>');
													$(".infomenu").append($(infolist));
												}
											}

										}
									})
								})
							})
						</script>

						{/loop}
						{if empty($list)}
						<tr class="yg5_tr2">
							<td colspan="12">
								暂无票卷信息
							</td>
						</tr>
						{/if}


					</table>
				</div>
			</form>
		</div>

	</div>
	<div class="text-right we7-margin-top">
		{$pager}
	</div>
	<script type="text/javascript">
		$(function(){
			$("#frame-10").show();
			$("#yframe-10").addClass("wyactive");
		})
	</script>